<?php


namespace app\api\controller;

/**
 * 功能说明: 信号强度类
 * Company:物联网应用专家---成都亿佰特电子科技有限公司
 * User: 郑文军
 * Time: 2021-10-11 17:50
 * version：1.0
 */
class Csq extends Base
{
    /**
     * 功能说明 获取信号强度列表
     * author 郑
     * time 2021-10-11 17:51
     */
    public function getList()
    {
        $search = request()->param();
        $search['pageSize']=isset($search['pageSize'])?$search['pageSize']:20;
        $where = [];
        if (isset($search['id'])) {
            $where['did'] = $search['id'];
        }
        $res = db('device_csq v')
            ->field("v.*")
            ->order("v.id desc")
            ->where($where)
            ->paginate($search['pageSize'], false, ['page' => $search['page']]);
        foreach ($res as $k => $v) {
            $v['create_time'] = date("Y-m-d h:i:s", $v['create_time']);
            $res[$k] = $v;
        }
        suc($res);
    }
}